<include file="../Public:header" />
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/ui.slider.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/timepicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/i18n/jquery-ui-i18n.js"></script>

<if condition="$act eq 'list'">
<script type="text/javascript">
		$(document).ready(function(){
			parent.showButton("add,del");
		});
		function doButton(btn) { 
		    if(btn == "add") {
		        location.href = "__URL__/index/act/add";
		    }else if(btn == "del") {
		        var str="";
		        $("input[name*='selected']:checked").each(function(){
		        	str += $(this).val()+",";
		        });
		        if(str.length > 0) {
			        if(confirm("您确认要删除吗？")) {
			        	$.getJSON("__URL__/index_act/act/del", { id: str },
				      			function(data){
				        			if(data.success == 1) {
				        				$("input[name*='selected']").attr('checked', false);
					        			location.reload();
				        			}else if(data.describe){
				        				alert(data.describe);
				        			}else {
				        				alert("请先选择欲删除的条目");
				        			}
				        		});
			        }
		        }else {
			        alert("请先选择欲删除的条目");
		        }
		    }
		}
		function filter(){
			if($("#filter_key").val() == '请输入班级名进行查找') {
				$("#filter_key").val('');
			}
			$("#form").submit();
		}
		
	</script>
        <div class="data-list">
         <!-- table class="list">
    		<form action="__URL__/index/" method="post" enctype="multipart/form-data" id="form">
	        <thead>
	          <tr class="filter">
	            <td class="right">关键字:　<input style="width:300px;" type="text" id="filter_key" name="filter_key" value="{$_mapx[filter_key]|default='请输入班级名进行查找'}"></td>
	            <td align="right"><a class="button" onclick="filter();"><span>筛选</span></a></td>
	          </tr>
	        </thead>
	        </form>
	      </table>
	       -->
	      <table class="list">
	        <thead>
	          <tr style="background-color: rgb(244, 244, 248);">
	          	<td width="1" style="text-align: center;">
	          	  <input type="checkbox" onclick="$('input[name*=\\\'selected\\\']').attr('checked', this.checked);">
	          	</td>
	            <td class="left">名称</td>
	            <td class="left">班级</td>
	            <td class="right">操作</td>
	          </tr>
	        </thead>
	        <tbody>
	        <volist name="list" id="val">
	          <tr>
	            <td style="text-align: center;">
	              <input type="checkbox" value="{$val.id}" name="selected[]">
	            </td>
	            <td class="left">{$val['name']}</td>
	            <td class="left">{$val['class_id']|getClassName}</td>
	            <td class="right">
					[ <a target="_blank" href="{$val.url}">管理摄像头</a> ]
					[ <a href="{$val.url}/cgi-bin/action?action=loadpage&page=/setup/user_account.html&lang=chs">用户管理</a> ]
	                [ <a href="__URL__/index/act/edit/id/{$val.id}">编辑</a> ]
	            </td>
	          </tr>
	        </volist>
	        </tbody>
	      </table>
	       <p align=right>{$page}</p>
		</div>
<elseif condition="$act eq 'add' ||$act eq 'edit'"/>
	<include file="index_edit"/>
<elseif condition="$act eq 'view'"/>
	<include file="index_view"/>
</if>
<include file="../Public:footer"/>